<?php
include('connection.php');
$login = $_GET['login'];
$password = $_GET['password'];
$query="SELECT * FROM user WHERE user_login='$login' AND user_pass='$password'";
$result = mysql_query($query);
$num=mysql_numrows($result);
if ($num==0){
	header( "Location: ../authorization.php?status=wrong" );
}
else{
$user_id = mysql_result($result,0,"user_id");
$user_name = mysql_result($result,0,"user_name");
$user_surname = mysql_result($result,0,"user_surname");
$user_login = mysql_result($result,0,"user_login");
$user_status = mysql_result($result,0,"user_status");
$_SESSION['user_id']=$user_id;
$_SESSION['user_name']=$user_name;
$_SESSION['user_surname']=$user_surname;
$_SESSION['user_login']=$user_login;
$_SESSION['user_status']=$user_status;
header( "Location: ../index.php" );
}
?>
